package main

import "fmt"

func main() {
	array := [3]float64{4.2, 5.3, 6.3}
	sum := Sum(array)
	fmt.Printf("sum: %.3f\n", sum)
}

// Sum 本函数可以改为传递指针Sum(a &[3]float64)
func Sum(a [3]float64) (sum float64) {
	for _, v := range a {
		sum += v
	}
	return
}
